<!DOCTYPE html>
<html lang="zh-CN"
      xmlns:th="http://www.thymeleaf.org">
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>增加管理员页面</title>
    <meta name="keywords" content="增加管理员页面">
    <meta name="description" content="增加管理员页面">

    <link rel="shortcut icon" th:href="@{favicon.ico}">
    <link th:href="@{css/bootstrap.min14ed.css}" rel="stylesheet">
    <link th:href="@{css/font-awesome.min93e3.css}" rel="stylesheet">
    <link th:href="@{css/animate.min.css}" rel="stylesheet">
    <link th:href="@{css/style.min862f.css}" rel="stylesheet">
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="col-sm-6">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>完整验证表单</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                        <i class="fa fa-wrench"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li><a href="form_basic.html#">选项1</a>
                        </li>
                        <li><a href="form_basic.html#">选项2</a>
                        </li>
                    </ul>
                    <a class="close-link">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            <div class="ibox-content">
                <form class="form-horizontal m-t" id="signupForm" action="/saveAdmin" method="post">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">用户名：</label>
                        <div class="col-sm-8">
                            <input id="username" name="username" class="form-control" type="text">
                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>用户名作为用户登录使用</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">真实姓名：</label>
                        <div class="col-sm-8">
                            <input id="realname" name="realname" class="form-control" type="text"><!--aria-required="true" aria-invalid="true" -->
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">密码：</label>
                        <div class="col-sm-8">
                            <input id="password" name="password" class="form-control" type="password">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">确认密码：</label>
                        <div class="col-sm-8">
                            <input id="confirm_password" name="confirm_password" class="form-control" type="password">
                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请再次输入您的密码</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">权限：</label>
                        <div class="col-sm-8">
                            <input type="checkbox" id="generalAdmin" name="limitBox1" checked="checked">&nbsp;&nbsp;&nbsp;一般管理员&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="checkbox" id="supperAdmin" name="limitBox2">&nbsp;&nbsp;&nbsp;超级管理员<!-- class="form-control"-->
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-8 col-sm-offset-3">
                            <button class="btn btn-primary" type="button" onclick="submitSave()">提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</div>


<script th:src="@{js/jquery.min.js}"></script>
<script th:src="@{js/bootstrap.min.js}"></script>
<script th:src="@{js/content.min.js}"></script>
<script th:src="@{js/plugins/validate/jquery.validate.min.js}"></script>
<script th:src="@{js/plugins/validate/messages_zh.min.js}"></script>
<script th:src="@{js/demo/form-validate-demo.min.js}"></script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>


<script type="application/javascript">
    function submitSave() {
        alert("开始");
     var username=document.getElementById("username").value;
     var pwd=document.getElementById("password").value;
     var obj= document.getElementsByName("limitBox");
      var check_val=[];
       for(var k in obj){
           if(obj[k].checked){
               check_val.push(obj[k].value);
           }
       }
       if(username=="" && pwd==""){
           alert("用户名或密码不能为空！");
       }else {
           document.getElementById("signupForm").submit();
       }

    }
</script>
</body>
</html>
